<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        ul{
            width: 300px;
            height: 100px;
            margin: 50px auto;
            background: aquamarine;
        }
        ul,li{
            list-style: none;
        }
        
    </style>
</head>
<body>
    <ul>
        <li>苦心人</li>
        <li>天不负</li>
        <li>卧薪尝胆</li>
        <li>三千越甲可吞吴</li>
    </ul>
    
    <script>
        let oUl = document.querySelector('ul');
        oUl.onclick = function(e){
            e = e || e.event;
            let txt = e.target.innerText;
            alert(txt + num) ;  
        }
    </script>    
</body>
</html>